version: '3'

services:
  postgres_db:
    image: postgres
    restart: always
    container_name: postgres_db
    environment:
      POSTGRES_DB: "weather_db"
      POSTGRES_USER: "weather_user"
      POSTGRES_PASSWORD: "weather_user_password"
    ports:
      - "5432:5432"

  app:
    container_name: app
    restart: always
    build: .
    ports:
      - "5000:5000"
    volumes:
      - .:/app
    depends_on:
      - postgres_db
    command: sh -c "sleep 10 && python3 init_test_data.py && python3 main.py"
